The imap engine requires no configuration.
Queries using the imap engine follow a simple
query language. The search is always case-insensitive and
supports the following features (inspired by the Google search
input language):
By default the whole message will be searched. The query can be limited to a specific part of a message by using a prefix-arg. After inputting the query this will prompt (with completion) for a message part. Choices include “Whole message”, “Subject”, “From”, and “To”. Any unrecognized input is interpreted as a header name. For example, typing Message-ID in response to this prompt will limit the query to the Message-ID header.
Finally selecting “Imap” will interpret the query as a raw IMAP search query. The format of such queries can be found in RFC3501.
If you don't like the default of searching whole messages you
can customize nnir-imap-default-search-key. For
example to use IMAP queries by default
(setq nnir-imap-default-search-key "Imap")